import service from "@/utils/request";

export const getExamListService = params =>
    service({
        url: '/exam/list',
        method: 'get',
        params
    })

export const addExamService = params => 
    service({
        url: '/exam/add',
        method: 'post',
        data: params
    })


export const addExamQuestionService = params => 
    service({
        url: '/exam/question/add',
        method: 'post',
        data: params
    })

export const getExamDetailService = examId => 
    service({
        url: '/exam/detail',
        method: 'get',
        params: { examId }
    })


export const editExamService = params => 
    service({
        url: '/exam/edit',
        method: 'put',
        data: params
    })


export const deleteExamQuestionService = (examId, questionId) => 
    service({
        url: '/exam/question/delete',
        method: 'delete',
        params: { examId, questionId }
    })


export const deleteExamService = examId => 
    service({
        url: '/exam/delete',
        method: 'delete',
        params: { examId }
    })


export const publishExamService = examId =>
    service({
        url: '/exam/publish',
        method: 'put',
        params: { examId }
    }) 


export const cancelPublishExamService = examId =>
    service({
        url: '/exam/cancelPublish',
        method: 'put',
        params: { examId }
    }) 